package orm.litchi.controller;

import orm.litchi.entity.User;
import orm.litchi.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import orm.litchi.Ultis.Result;

import java.util.List;

@RestController
@EnableAutoConfiguration
public class UserController {

    @Autowired
    UserService userService;

    @RequestMapping("/getUser")
    @ResponseBody
    public Result getUser(){

        List data = userService.getAllUser();

        return Result.success(data);

    }


    @RequestMapping("/getUser/1")
    @ResponseBody
    public Result getUsers(){

        return Result.success(userService.getUserByID(1));

    }


    @RequestMapping("/getUserLike")
    @ResponseBody
    public Result getUserLike(){

        return Result.success(userService.getUserLike("云"));

    }

}
